package com.xinxing.city.recoverycheck.sdk_ttys;

import android.util.Log;



import ZtlApi.ZtlManager;

public class ZtlTools {


    public static String getDeviceMdeo() {
        if (CC.devsn == null) {
            CC.devsn = ZtlManager.getDeviceVersion();//DeviceID 为获取到的设备型号
        }
        return CC.devsn;
    }

    //保活
    public static void keepActivity() {



            ZtlManager.GetInstance().keepActivity("com.xinxing.city.recovery");
            ZtlManager.GetInstance().setDesktop("com.android.launcher3");//
            ZtlManager.GetInstance().setBootPackageActivity("com.xinxing.city.recovery", "com.xinxing.city.recovery.SplashActivity");

            String pkgName3 = ZtlManager.GetInstance().getBootPackageName();

            System.err.println("获取设置的开机自启动APP的包名:" + pkgName3);

    }


    //取消保活 取消系统桌面
    public static void unKeepActivity() {

            Log.e("TTT","取消保活");
            ZtlManager.GetInstance().unKeepActivity();
            ZtlManager.GetInstance().unkeepService();
            /* 将包名设备为其它的不存在的包名 找不到就不会启动 */
            ZtlManager.GetInstance().setBootPackageActivity("com.aa.aa", "com.aa.aa.bb");
            ZtlManager.GetInstance().setDesktop("com.android.launcher3");//
            String pkgName3 = ZtlManager.GetInstance().getBootPackageName();//pkgName 为获取到的开机自启动 APP 包名

            System.err.println("获取设置的开机自启动APP的包名:" + pkgName3);

    }

    public static void installApk(String path){
        ZtlManager.GetInstance().installAppAndStartUp(path,"com.xinxing.city.recovery");
    }
    public static String getDeviceId(){
       return ZtlManager.GetInstance().getDeviceID();
    }
    //取消保活 取消系统桌面
    public static void reboot() {


        ZtlManager.GetInstance().reboot(5);


    }

}
